import request from '@/utils/request'

/**
 * 查看告警记录列表
 *
 * @param { page, pageSize, poleName, poleNumber, handleStatus } params
 *
 * @returns  {Promise}
  */
export function getWarningListAPI(params) {
  return request({
    url: '/pole/warning/list',
    method: 'get',
    params
  })
}

/**
 * 获取告警详情
 *
 * @param { String } id
 *
 * @returns  {Promise}
 */
export function getWarningDetailsAPI(id) {
  return request({
    url: `/pole/warning/${id}`,
    method: 'get'
  })
}

/**
 * 删除告警记录
 *
 * @param { String } id
 *
 * @returns  {Promise}
 */
export function deleteWarningAPI(id) {
  return request({
    url: `/pole/warning/${id}`,
    method: 'delete'
  })
}

/**
 * 派单
 *
 * @param { id, userId } data
 *
 * @returns  {Promise}
 */
export function handleWarningAPI(data) {
  return request({
    url: '/pole/warning/send',
    method: 'put',
    data
  })
}
